package com.atguigu08.construct.ex3;

public class Account {
    String id;
    double balance;//余额
    double annualInterstRate;

    public Account(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public double getAnnualInterstRate() {
        return annualInterstRate;
    }

    public void setAnnualInterstRate(double annualInterstRate) {
        this.annualInterstRate = annualInterstRate;
    }

    public void withdraw(double m){
        if(this.balance>=m){
            this.balance-=m;
            System.out.println("取出："+m+" 余额为："+balance);
        }else{
            System.out.println("钱不够");
        }
    }

    public void desposit(double m){
        this.balance+=m;
        System.out.println("存入："+m+" 余额为："+balance);
    }


}
